<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

Route::get('AdminLogin', 'Admin\AdminLogin@index')->name('Admin.login');

Route::post('AdminLogin', 'Admin\AdminLogin@doLogin')->name('Admin.doLogin');

Route::get('AdminCaptcha', 'Admin\AdminLogin@captcha')->name('Admin.captcha');

Route::get('AdminSingout', 'Admin\AdminLogin@singOut')->name('Admin.singOut');

//定义后台路由
Route::prefix('Admin')->middleware('adminauth')->group(function() {

  Route::get('/', 'Admin\AdminIndexController@index')->name('Admin.index');

  require(__DIR__.'/AdminGym.php');
  require(__DIR__.'/AdminLzc.php');
  require(__DIR__.'/AdminWc.php');
  require(__DIR__.'/AdminCjh.php');
  require(__DIR__.'/AdminZjj.php');

});


//定义前台路由
Route::prefix('Home')->group(function() {

  Route::get('/', 'Home\HomeIndex@index')->name('Home.index');

  require(__DIR__.'/HomeGym.php');
  require(__DIR__.'/HomeLzc.php');
  require(__DIR__.'/HomeWc.php');
  require(__DIR__.'/HomeCjh.php');
  require(__DIR__.'/HomeZjj.php');

});
